﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nhibernate.GuitarStore.DataAccess;
using Nhibernate.GuitarStore.Common;

namespace Nhibernate.GuitarStore.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            NHibernateBase NHB = new NHibernateBase();
            NHB.Initialize("NHibernate.GuitarStore");

            System.Console.WriteLine("NHibernate.GuitarStore assembly initialized.");
            System.Console.WriteLine();

            IList<Inventory> list1 = NHibernateBase.StatelessSession.CreateQuery("from Inventory").List<Inventory>();
            System.Console.WriteLine("Using IQuery / StatelessSession / Inventory: " + list1.Count().ToString() + " results");
            System.Console.WriteLine();
            IList<Inventory> list2 = NHibernateBase.Session.CreateCriteria(typeof(Inventory)).List<Inventory>();
            System.Console.WriteLine("Using ICriteria / Session / Inventory: " + list2.Count().ToString() + " results");
            System.Console.WriteLine();
            //IQueryable<Inventory> linq = (from l in NHibernateBase.Session.Query<Inventory>() select l);
            //System.Console.WriteLine("Using LINQ / Session / Inventory: " + linq.Count().ToString() + " results");


            System.Console.ReadLine();
        }
    }
}
